const express = require('express');
const bodyParser = require("body-parser");
const uploadRouter = require('./routers.js');
const middlewares = require("./global_error.js");
const app = express();
// 自定义 获取post 请求体的数据
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use(uploadRouter);


// 全局错误
app.use(middlewares.recordErrLogs);
// 启动服务
app.listen(3030, '127.0.0.1', () => {
    console.log("running...")
})